<script type="text/javascript" src="../../static/js/mootools-1.2.1-core-nc.js"></script>
<script type="text/javascript" src="../../static/js/sidebar.js"></script>

<div id="sidebar">
	<div id="sidebar-wrapper">
		<div >
			<div class="s-logo">
				<p class="r-logo"><a href="/">iHere</a></p>
			</div>		
		</div>
		<div class="box-simple">
			<div class="box-simple-top"></div>
			<div id="mainLoginArea" class="box-simple-content">
				<span style="color:red;">Profile Panel</span>
				<ul>
				{%if user%}
					<li><a href="/user/profile/{{user.nickname}}">{{user.nickname}}</a>已登入</li>
					<li><a href="/user/logout/" onclick="{if(confirm('确定要登出吗?')){return true;}return false;}">登出</a></li>
		        {%endif%}
		        {%if not user%}
		        	<li><a href="/user/login/">登录</a></li>
		        {%endif%}
				</ul>
			</div>
			<div class="box-simple-bottom"></div>
		</div>
		<div class="box-simple">
			<div class="box-simple-top"></div>
			<div id="mainLoginArea" class="box-simple-content">
				<li><a href="/">首页</a></li>
				<li><a href="feeds/latest/">Latest Feeds</a></li>
			</div>
		</div>
	</div>
	
</div>
{%if user%}
<div style="position:absolute;top:120px;width:120px;right:80px;">
		<div class="box-simple">
			<div class="box-simple-top"></div>
			<div id="mainLoginArea" class="box-simple-content">
				<span style="color:red;">Action Panel</span>
				<p>
		        <li><a href="/post/add/">新增文章</a></li>
				{%if post%}
					{%ifequal user post.author%}
						<li><a href="/post/edit/{{ post.key.id }}">编辑当前文章</a><br></li>
						<li><a href="/post/delete/{{ post.key.id }}" onclick="{if(confirm('确定要删除当前文章吗?')){return true;}return false;}">删除当前文章</a></li>
					{%endifequal%} 
				{%endif%}
			</div>
			<div class="box-simple-bottom"></div>
		</div>
</div>
{%endif%}